﻿/********************************************************************************
** @ Date:2022/08/05
** @ Author: Gaojia
** @ Description: 自定义红外热成像控件
** @ Version:1.0.0
** @ Fun:
********************************************************************************/

#ifndef CLabelIr_H
#define CLabelIr_H
#include <QWidget>
#include <QPainter>
#include <QPointF>
#include <QPoint>
#include <QMutex>
#include <QAction>
#include <QTimer>
#include <math.h> 
#include <QMoveEvent>
#include <QMenu>
#include <QKeyEvent>
#define  PICWIDTH 1280;
#define  PIGHEIGHT 960;
class CLabelIr : public QWidget
{
	Q_OBJECT
public:
	CLabelIr(QWidget *parent);
	~CLabelIr();
	QString m_sFilePath;
	double  m_dMaxTemp;   //最高温度
	double  m_dMinTemp;   //最低温度
	QPoint  m_cPointMax;
	QPoint  m_cPointMin;
	QRect   m_cRectChose;   
	double  m_dMaxTempOn;   //选中最高温度
	double  m_dMinTempOn;   //选中最低温度
	void InitUi(QString sFilePath);//初始化界面

protected:
	void mouseMoveEvent(QMouseEvent * event)override;
	void mousePressEvent(QMouseEvent *event)override;
	void mouseReleaseEvent(QMouseEvent* event)override;
	void paintEvent(QPaintEvent *)override;

private:
	void GetMyTempPix();       //获取m_mapMyTempPix
	void GetRectTemp(QPoint pA, QPoint pB);
	bool    m_bPressed;        //鼠标左键是否按下
	QPoint m_pPointA;
	QPoint m_pPointB;
	QPixmap *m_pPixmapA;
	QString m_sFileName;  //图片文件名称
	QMap<int, float>m_mapMyTempPix;
};

#endif